﻿<!DOCTYPE html>
<html>
<head>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
    <div id="pageWrapper">
        <header>
            <h1>
                <a href="@this.Url.Action("Index", "Dashboard")">vITs Reserapporterare</a>
            </h1>
        @if (this.User.Identity.IsAuthenticated)
        {
            var user = (from vITs.Site.Models.DataModels.User u in new vITs.Site.Models.DataModels.VitsDB().Users where u.EmailAddress == this.User.Identity.Name select u).SingleOrDefault();
            if (user != null)
            {
                @:Inloggad som: @user.GivenName @user.Surname (@this.Html.ActionLink("Logga ut", "SignOut", "User"))
            }
            
        }
        </header>
        
        @if (IsSectionDefined("Sidebar")) {
        <div id="sidebar">
            <h3>Sidebar</h3>
            @this.RenderSection("Sidebar", false)
        </div>
        }
        
        @if (this.User.Identity.IsAuthenticated)
        {
        <nav>
            <ul>
                @if (Roles.IsUserInRole("Konsult"))
                {
                    <li>
                        <a href="@this.Url.Action("AssignmentList", "Consultant")">Mina Uppdrag</a>
                    </li>
                }
                @if (Roles.IsUserInRole("Chef"))
                {
                    <li>
                        <a href="@this.Url.Action("AssignmentList","Handler")">Uppdrag</a>
                    </li>
                }
                @if (Roles.IsUserInRole("Administratör"))
                {
                    <li>
                        <a href="@this.Url.Action("Index", "PerDiem")">Traktamenten</a>
                    </li>
                    <li>
                        <a href="@this.Url.Action("Index","User")">Användare</a>
                    </li>
                    <li>
                        <a href="@this.Url.Action("Index","Account")">Konton</a>
                    </li>
                }
            </ul>
        </nav>
        }
        <div id="contentWrapper">
            @this.RenderBody()
        </div>
        <footer>
            <p>Copyright &copy; 2012 vITs Utbildningar </p>
        </footer>
    </div>
</body>
</html>
